A node in the tree structure representing the data to export / import. More...
Public Member Functions | |
Node () | |
Node (const Node &other) | |
Node (Node &&other) | |
~Node () | |
NODE_NATURE | getNodeNature () const |
NODE_VALUE_TYPE | getNodeValueType () const |
bool | isValueTypeNumber () const |
nkMemory::StringView | getValueAsString () const |
int | getValueAsInt () const |
unsigned int | getValueAsUint () const |
long long | getValueAsLong () const |
unsigned long long | getValueAsUlong () const |
float | getValueAsFloat () const |
double | getValueAsDouble () const |
bool | getValueAsBool () const |
unsigned int | getMemberCount () const |
nkMemory::StringView | getMemberKey (unsigned int index) |
Node * | getMemberValue (unsigned int index) |
Node * | getMemberValue (const nkMemory::StringView &key) |
unsigned int | getArraySize () const |
Node * | getArrayElement (unsigned int index) |
void * | getUserData () const |
void | setAsString (const nkMemory::StringView &value) |
void | setAsInt (int value) |
void | setAsUint (unsigned int value) |
void | setAsLong (long long value) |
void | setAsUlong (unsigned long long value) |
void | setAsFloat (float value) |
void | setAsDouble (double value) |
void | setAsBool (bool value) |
Node * | addMember (const nkMemory::StringView &key) |
void | deleteMember (const nkMemory::StringView &key) |
Node * | addElement () |
void | setUserData (void *value) |
Node & | operator= (const Node &other) |
Node & | operator= (Node &&other) |
A node in the tree structure representing the data to export / import.
nkExport::Node::Node | ( | ) |
Constructor.
nkExport::Node::Node | ( | const Node & | other | ) |
Copy constructor.
other | The node to copy from. |
nkExport::Node::Node | ( | Node && | other | ) |
Move constructor.
other | The node to move. |
nkExport::Node::~Node | ( | ) |
Destructor.
NODE_NATURE nkExport::Node::getNodeNature | ( | ) | const |
NODE_VALUE_TYPE nkExport::Node::getNodeValueType | ( | ) | const |
bool nkExport::Node::isValueTypeNumber | ( | ) | const |
nkMemory::StringView nkExport::Node::getValueAsString | ( | ) | const |
int nkExport::Node::getValueAsInt | ( | ) | const |
unsigned int nkExport::Node::getValueAsUint | ( | ) | const |
long long nkExport::Node::getValueAsLong | ( | ) | const |
unsigned long long nkExport::Node::getValueAsUlong | ( | ) | const |
float nkExport::Node::getValueAsFloat | ( | ) | const |
double nkExport::Node::getValueAsDouble | ( | ) | const |
bool nkExport::Node::getValueAsBool | ( | ) | const |
unsigned int nkExport::Node::getMemberCount | ( | ) | const |
nkMemory::StringView nkExport::Node::getMemberKey | ( | unsigned int | index | ) |
Allows to retrieve a key of a member, like if they were indexable. Can be used to inspect an unknown structure, for instance.
index | The index of the member key to retrieve. For instance, if a node has 5 members, it would be possible to index them from 0 to 4. |
Node* nkExport::Node::getMemberValue | ( | unsigned int | index | ) |
Allows to retrieve a member, like if they were indexable. See nkExport::Node::getMemberKey for more details.
index | The index of the member to retrieve. |
Node* nkExport::Node::getMemberValue | ( | const nkMemory::StringView & | key | ) |
Allows to get a member directly from its key.
key | The key identifying the wanted member. |
unsigned int nkExport::Node::getArraySize | ( | ) | const |
Node* nkExport::Node::getArrayElement | ( | unsigned int | index | ) |
index | The index at which to index the array. |
void* nkExport::Node::getUserData | ( | ) | const |
void nkExport::Node::setAsString | ( | const nkMemory::StringView & | value | ) |
Converts the node to hold a string.
value | The string to attach to this node. |
void nkExport::Node::setAsInt | ( | int | value | ) |
Converts the node to hold an int.
value | The int to attach to this node. |
void nkExport::Node::setAsUint | ( | unsigned int | value | ) |
Converts the node to hold an unsigned int.
value | The unsigned int to attach to this node. |
void nkExport::Node::setAsLong | ( | long long | value | ) |
Converts the node to hold a long (8 bytes).
value | The long to attach to this node. |
void nkExport::Node::setAsUlong | ( | unsigned long long | value | ) |
Converts the node to hold an unsigned long (8 bytes).
value | The unsigned long to attach to this node. |
void nkExport::Node::setAsFloat | ( | float | value | ) |
Converts the node to hold a float.
value | The float to attach to this node. |
void nkExport::Node::setAsDouble | ( | double | value | ) |
Converts the node to hold a double.
value | The double to attach to this node. |
void nkExport::Node::setAsBool | ( | bool | value | ) |
Converts the node to hold a boolean.
value | The bool to attach to this node. |
Node* nkExport::Node::addMember | ( | const nkMemory::StringView & | key | ) |
Converts the node as an object to hold child members.
key | The key of the member to add. |
void nkExport::Node::deleteMember | ( | const nkMemory::StringView & | key | ) |
Allows to erase a member from the node.
key | The key of the member to delete. |
Node* nkExport::Node::addElement | ( | ) |
Converts the node into an array to index children.
void nkExport::Node::setUserData | ( | void * | value | ) |
Allows to attach user data to the node. This data is ignored by the component, and can be used by the client application if any information needs to be communicated by this mean.
value | The data to attach to this node. |
Copy assignment operator.
other | The node to copy from. |
Move assignment operator.
other | The node to move. |